package com.gzy.cbrsystem.nephritis.action;

import java.util.ArrayList;
import java.util.List;


import com.gzy.cbrsystem.nephritis.dao.Nephritis;
import com.gzy.cbrsystem.nephritis.dao.YaZb;
import com.gzy.cbrsystem.nephritis.dao.YaZbDAO;
import com.gzy.cbrsystem.shimian.action.KeyWordSearch;

import com.opensymphony.xwork2.ActionSupport;

public class SearchNephritisAction extends ActionSupport {
	
	
	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected String searchmean;
	protected KeyWordSearch keyWordSearch;
	protected String keywordArray[];
	protected YaZbDAO yaZbDAO;
	protected List<Nephritis> results;
	protected String query;
	
	public String getSearchmean() {
		return searchmean;
	}
	public void setSearchmean(String searchmean) {
		this.searchmean = searchmean;
	}
	public KeyWordSearch getKeyWordSearch() {
		return keyWordSearch;
	}
	public void setKeyWordSearch(KeyWordSearch keyWordSearch) {
		this.keyWordSearch = keyWordSearch;
	}
	public String[] getKeywordArray() {
		return keywordArray;
	}
	public void setKeywordArray(String[] keywordArray) {
		this.keywordArray = keywordArray;
	}
	public YaZbDAO getYaZbDAO() {
		return yaZbDAO;
	}
	public void setYaZbDAO(YaZbDAO yaZbDAO) {
		this.yaZbDAO = yaZbDAO;
	}
	public List<Nephritis> getResults() {
		return results;
	}
	public void setResults(List<Nephritis> results) {
		this.results = results;
	}
	public String getQuery() {
		return query;
	}
	public void setQuery(String query) {
		this.query = query;
	}
	public SearchNephritisAction()
	{
		this.results=new ArrayList<Nephritis>();
	}
	public List<YaZb> search(String query)
	{
		return this.yaZbDAO.findAll();
	}
	public String execute() throws Exception {
		
		this.results=new ArrayList<Nephritis>();
		for(YaZb y:this.search(query))
		{
			Nephritis n=new Nephritis();
			n.setYazb(y);
			this.results.add(n);
		}
		return SUCCESS;

	}
}
